package com.justech.eat.service.impl;

import com.justech.eat.entity.OrderParameter;
import com.justech.eat.mapper.mysql.OrderParameterMapper;
import com.justech.eat.service.OrderParameterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class OrderParameterServiceImp implements OrderParameterService {


    @Autowired
    OrderParameterMapper orderParameterMapper;

    @Override
    public void save(OrderParameter orderParameter) {
        orderParameter.setCreatTime(new Date());
        orderParameterMapper.save(orderParameter);
    }

    @Override
    public void update(OrderParameter orderParameter) {
        orderParameter.setUpdateTime(new Date());
        orderParameterMapper.update(orderParameter);
    }

    @Override
    public OrderParameter query(int dateType) {
        return orderParameterMapper.query(dateType);
    }


}
